package com.thd.springboot.project.camundamanager.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;
import java.util.List;
import java.util.Map;
@ApiModel(value="任务实体",description="流程实例的任务实体")
public class ProcessInstanceTaskEntity extends ProcessInstanceEntity {
    @ApiModelProperty(value = "任务ID")
    private String taskId;
    @ApiModelProperty(value = "执行ID")
    private String executionId;

    @ApiModelProperty(value = "任务名称")
    private String taskName;

    @ApiModelProperty(value = "任务的KEY(bpmn中的id)")
    private String taskDefKey;

    @ApiModelProperty(value = "任务所属人")
    private String taskOwner;

    @ApiModelProperty(value = "任务指派人")
    private String taskAssignee;

    @ApiModelProperty(value = "任务候选人")
    private List<String> candidates;

    @ApiModelProperty(value = "formKey")
    private String taskFormKey;

    @ApiModelProperty(value = "任务开始时间",notes="格式:yyyy-MM-dd  hh:mm:ss")
    @JsonFormat( pattern="yyyy-MM-dd  hh:mm:ss",timezone = "GMT+8")
    private Date taskStartTime;

    @ApiModelProperty(value = "任务结束时间",notes="格式:yyyy-MM-dd  hh:mm:ss")
    @JsonFormat( pattern="yyyy-MM-dd  hh:mm:ss",timezone = "GMT+8")
    private Date taskEndTime;

    @ApiModelProperty(value = "该任务可见的流程变量")
    private Map<String,Object> taskVar;

    @ApiModelProperty(value = "该任务所属执行可见的流程变量")
    private Map<String,Object> executionVar;

    public static ProcessInstanceTaskEntity createInstance(){
        return new ProcessInstanceTaskEntity();
    }

    public String getTaskId() {
        return taskId;
    }

    public ProcessInstanceTaskEntity setTaskId(String taskId) {
        this.taskId = taskId;
        return this;
    }

    public String getExecutionId() {
        return executionId;
    }

    public ProcessInstanceTaskEntity setExecutionId(String executionId) {
        this.executionId = executionId;
        return this;
    }

    public String getTaskName() {
        return taskName;
    }

    public ProcessInstanceTaskEntity setTaskName(String taskName) {
        this.taskName = taskName;
        return this;
    }

    public String getTaskDefKey() {
        return taskDefKey;
    }

    public ProcessInstanceTaskEntity setTaskDefKey(String taskDefKey) {
        this.taskDefKey = taskDefKey;
        return this;
    }

    public String getTaskOwner() {
        return taskOwner;
    }

    public ProcessInstanceTaskEntity setTaskOwner(String taskOwner) {
        this.taskOwner = taskOwner;
        return this;
    }

    public String getTaskAssignee() {
        return taskAssignee;
    }

    public ProcessInstanceTaskEntity setTaskAssignee(String taskAssignee) {
        this.taskAssignee = taskAssignee;
        return this;
    }

    public String getTaskFormKey() {
        return taskFormKey;
    }

    public ProcessInstanceTaskEntity setTaskFormKey(String taskFormKey) {
        this.taskFormKey = taskFormKey;
        return this;
    }

    public Date getTaskStartTime() {
        return taskStartTime;
    }

    public ProcessInstanceTaskEntity setTaskStartTime(Date taskStartTime) {
        this.taskStartTime = taskStartTime;
        return this;
    }

    public Map<String, Object> getTaskVar() {
        return taskVar;
    }

    public ProcessInstanceTaskEntity setTaskVar(Map<String, Object> taskVar) {
        this.taskVar = taskVar;
        return this;
    }

    public Map<String, Object> getExecutionVar() {
        return executionVar;
    }

    public ProcessInstanceTaskEntity setExecutionVar(Map<String, Object> executionVar) {
        this.executionVar = executionVar;
        return this;
    }

    public List<String> getCandidates() {
        return candidates;
    }

    public void setCandidates(List<String> candidates) {
        this.candidates = candidates;
    }


    public Date getTaskEndTime() {
        return taskEndTime;
    }

    public ProcessInstanceTaskEntity setTaskEndTime(Date taskEndTime) {
        this.taskEndTime = taskEndTime;
        return this;
    }
}
